<?php

namespace App\Listeners;

use App\Events\VerifyCodeEvent;
use App\Http\Service\EncryptionService;
use App\Http\Service\OrderService;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Log;

class VerifyListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  \App\Events\VerifyCodeEvent  $event
     * @return void
     */
    public function handle(VerifyCodeEvent $event)
    {
        try {
            OrderService::verify_code($event->id);
        }catch (\Exception $exception){
            return ['code'=>20000,'msg'=>$exception->getMessage(),'data'=>[]];
        }
    }
}
